"""
开放商户 - 费率信息变更相关模型
"""

from jlpay.model.base import OrgBaseReq, BaseResponse


class RateInfoChangeRequest(OrgBaseReq):
    """费率信息变更请求"""
    
    API_URL = "/open/merch/access/rate-info/modify"
    
    def __init__(self):
        """初始化费率信息变更请求"""
        super().__init__()
        self.apply_id = None
        self.merch_no = None
        self.rate_info = None
    
    def set_apply_id(self, apply_id):
        """
        设置业务申请编号
        
        Args:
            apply_id: 业务申请编号
            
        Returns:
            RateInfoChangeRequest实例
        """
        self.apply_id = apply_id
        return self
    
    def set_merch_no(self, merch_no):
        """
        设置商户号
        
        Args:
            merch_no: 商户号
            
        Returns:
            RateInfoChangeRequest实例
        """
        self.merch_no = merch_no
        return self
    
    def set_rate_info(self, rate_info):
        """
        设置费率列表
        
        Args:
            rate_info: 费率列表
            
        Returns:
            RateInfoChangeRequest实例
        """
        self.rate_info = rate_info
        return self


class RateInfoChangeResponse(BaseResponse):
    """费率信息变更响应"""
    
    def __init__(self, response_dict=None):
        """初始化费率信息变更响应"""
        super().__init__(response_dict)
        self.merch_no = None
        self.apply_id = None
        
        if response_dict:
            self.merch_no = response_dict.get('merch_no')
            self.apply_id = response_dict.get('apply_id') 